def count():
    fs = []
    for i in range(1, 4):
        def f(i):
             return i*i
        fs.append(f(i))
    return fs

f1, f2, f3 = count()
print(f1,f2,f3)

def createCounter():
    c = 0
    def counter():
        nonlocal c
        c += 1
        return c
    return counter
a=createCounter()
print(a(),a(),a())
